package com.boot.project.core.enums.code.impl.commonCode;

import com.boot.project.core.enums.code.BaseCode;
import lombok.AllArgsConstructor;

/**
 * @description:
 * @author: tsing
 * @create: 2020-08-09 14:55
 */
@AllArgsConstructor
public enum MicroServiceCode implements BaseCode {

    // 3.微服务相关(3001~3100)
    INVOKING_FAILURE(false, 3001, "服务间调用失败"),
    INVOKING_TIMEOUT(false, 3002, "服务间调用超时"),
    INVOKING_TOO_FAST(false, 3003, "访问频率过高，请稍后再试"),
    INVOKING_OCCUR_ERROR(false, 3004, "服务间调用出错，请稍后再试"),
    ;

    private Boolean success; // 是否成功
    private int code; // 状态码
    private String message; // 操作信息

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
